package com.ctgu.computer.mapper;

import com.ctgu.computer.annotation.FillNowTime;
import com.ctgu.computer.domain.po.ReportInfo;
import com.github.pagehelper.Page;
import lombok.Data;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ReportMapper {
    @Select("select * from report_info where report_sender=#{userId} order by create_time desc")
    Page<ReportInfo> listByCurrentUser(Integer userId);

    @FillNowTime
    void insert(ReportInfo reportInfo);

    @Select("select * from report_info where report_id=#{reportId}")
    ReportInfo selectById(Integer reportId);

    @Delete("delete from report_info where report_id=#{reportId}")
    void deleteById(Integer reportId);
}
